package com.zzxx.controller;

import com.zzxx.pojo.Product;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class VueController {
    @RequestMapping("/vue/ajax")
    public String ajax( String username){
        System.out.println(username);
        return username + "hello";
    }

    @RequestMapping("/vue/post")
    public String post(@RequestBody Product product){
        System.out.println(product.getId());
        return product.getProductName() + "hello";
    }
}
